<?php

namespace app\job\timer;

use Swoole\Process;

class Timer
{
    public function __construct(Process\Pool $pool, $config)
    {
        \Swoole\Timer::tick(5000, function (int $timer_id, ...$params) {
            var_dump("自定义的定时器id：{$timer_id}， 当前时间是" . date('Y-m-d H:i:s'));
        });
    }
}